Skip to content

fix(cloud): authenticate task requests before payload validation - #1361

Merged
groupthinking merged 2 commits into
mainfrom
execution-enforce-cloud-tasks-authentication-before-grv-198-fba7
Aug 29, 2026
Merged

fix(cloud): authenticate task requests before payload validation#1361
groupthinking merged 2 commits into
mainfrom
execution-enforce-cloud-tasks-authentication-before-grv-198-fba7

Conversation

@groupthinking

Copy link
Copy Markdown
Owner

Canonical issue

Closes #1134

Outcome

/api/v3/process-video-task now checks the Cloud Tasks X-CloudTasks-TaskName gate before parsing the request body. Unauthorized malformed calls return 403; authorized malformed calls (including invalid UTF-8 bodies) keep strict 422 validation; authorized valid calls behave exactly as before.

Scope

  • Included: src/youtube_extension/backend/cloud_api_endpoints.py, tests/unit/test_cloud_routes.py — an exact port of the canonical two-file artifact from fix(cloud): authenticate task requests before payload validation (#1134) #1132 (head 42939e0012ed2d3bab18de445655c98da0ad6980) onto current main, since that branch is now in a conflicting (dirty) merge state.
  • Explicitly excluded: Cloud Tasks queue construction, payload format changes, auth expansion, production configuration, unrelated refactors.

Risk

  • Risk level: low
  • Failure mode: body parsing regression on the task handler; the OpenAPI request-body schema is preserved via openapi_extra and covered by a test.
  • Rollback: revert the single two-file commit.

Verification

  • Focused tests: pytest tests/unit/test_cloud_routes.py -k process_video_task --no-cov — 7 passed (403-before-422 ordering, malformed authorized 422, invalid UTF-8 422, OpenAPI schema)
  • Full tests/unit/test_cloud_routes.py — 93 passed
  • ruff check on both files — only pre-existing B904 findings in untouched code
  • Required CI on this head
  • Review threads resolved

Production evidence

No production mutation is authorized by the linked issue; not applicable.

Agent handoff

  • One canonical issue is linked
  • No competing PR implements the same issue — fix(cloud): authenticate task requests before payload validation (#1134) #1132 contains the same artifact but is stale/conflicting against main; one of the two should be closed once this head verifies
  • Acceptance criteria are satisfied
  • Required checks pass on the current head
  • Human decision is requested only for product, security, irreversible infrastructure, or production approval

Agent provenance

Port the canonical two-file artifact from PR #1132 (exact head
42939e0) onto current main:
/api/v3/process-video-task now checks the X-CloudTasks-TaskName gate
before parsing the body, so unauthorized malformed calls return 403
while authorized malformed calls keep strict 422 validation (including
invalid UTF-8 bodies via errors(include_input=False)). The request-body
schema stays documented in OpenAPI via openapi_extra.

Generated with [Linear](https://linear.app/myxstack/issue/GRV-198/execution-enforce-cloud-tasks-authentication-before-payload-validation#agent-session-95a9c398)

Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
@linear-code

linear-code Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

GRV-198

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v0-uvai Ready Ready Preview, v0 Aug 29, 2026 7:51am

@github-actions github-actions Bot added the python label Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 611a09d6-519c-44cb-ba84-d5ee070b1884


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA e8d6637.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Agent Completion Truth Gate: BLOCKED

Reasons: evidence_collection_failed, missing_agent_result, missing_copilot_current_head_review, missing_copilot_rabbit_label, draft_pr

Machine-readable verdict
{
  "details": {
    "collection_errors": [
      "missing_intent_snapshot",
      "agent_run_id_mismatch",
      "agent_login_mismatch"
    ],
    "identity_projection": {
      "agent_login": "groupthinking",
      "issue_number": 1134,
      "run_id": "eventrelay-daily-control-20260731-1317z"
    }
  },
  "reasons": [
    "evidence_collection_failed",
    "missing_agent_result",
    "missing_copilot_current_head_review",
    "missing_copilot_rabbit_label",
    "draft_pr"
  ],
  "verdict": "blocked"
}

Workflow evidence

@groupthinking
groupthinking merged commit 5dc0afb into main Aug 29, 2026
21 of 27 checks passed
@groupthinking
groupthinking deleted the execution-enforce-cloud-tasks-authentication-before-grv-198-fba7 branch August 29, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Execution: enforce Cloud Tasks authentication before payload validation (PR #1132)

1 participant